package org.junyi.util;
import org.apache.shiro.codec.Base64;
import org.apache.shiro.crypto.hash.Md5Hash;
public class CryptographyUtil  
{
	//加密
	public static String entoBase64(String str){
		String base64Encoded = Base64.encodeToString(str.getBytes());
		return base64Encoded;  
	}
	//解密
	public static String dstoString(String str){
		String str2 = Base64.decodeToString(str);
		return str2;
	}
	
	//加盐  md5加密
	public static String md5(String str,String salt){
		String md5 = new Md5Hash(str, salt).toString();
		return md5;
	}
}
